import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		while(true)
		{int number;
		String s=input.next();
		number=Integer.parseInt(s);
		if(number>=10000&&number<=20000)
		{
		System.out.println(Integer.toBinaryString(number)+','+Integer.toOctalString(number)+','+Integer.toHexString(number) );		
		}
		else{int i,sum=0;
			for(i=0;i<s.length();i++)
			{
				if(s.charAt(i)=='-')i++;
				System.out.print(s.charAt(i)+" ");
				sum=sum+s.charAt(i)-'0';	
			}
			System.out.println(sum);
		}
		
		}
	}

}
